<?php
	require_once('model/User.php');
	require_once('model/Question.php');
	require_once('model/Car.php');
	require_once('model/News.php');

	final class Main extends Controller {
		public function Index() {
			$this->headers['Content-type'] = 'text/html';
			$this->stylesheet = 'Main-page';
			
			//News::CreateNewsFish(12);
			//Car::CreateCarFish(80);
			
			$this->page->MountSource(Question:: FAQ(2));
			
			$this->page->MountSource(News::NewsByCount(2));
			
			$this->page->MountSource(Car::SalonDevelopers());
			
			if(isset($this->params['developer_alias'])){
				$dev = $this->params['developer_alias'];
				$this->page->MountSource(Car::CarsByDeveloper($dev,CAR_STATUS_SALON,CAR_ACTIVE_SHOW));
			}
			else{
				$this->page->MountSource(Car::CarsByDeveloper('',CAR_STATUS_SALON,CAR_ACTIVE_SHOW,9));
			}
			
						
		}

		public function UnknownRoute() {
			$this->params['ERROR'] = true;
		}

		public function Help() {
			header('Content-type: text/html');
			phpinfo();
			die();
		}
		
		public function Test() {
			$this->headers['Content-type'] = 'text/html';
			$this->stylesheet = 'base-template.imp';
			$this->page->MountSource(Car::CarsByDeveloper('',CAR_STATUS_BYOWNER,CAR_ACTIVE_SHOW,3));			
		}		
	}
?>